package com.example.lib_audio.tools

import android.animation.ObjectAnimator
import android.view.View
import android.view.animation.AnimationUtils
import android.view.animation.RotateAnimation
import android.widget.ImageView
import com.example.lib_audio.R

object NeedleAnimation {

    fun startAnimation(target: View){
        AnimationUtils.loadAnimation(target.context, R.anim.indicator_rotate_anim_start).apply {
            fillAfter = true  //保存最后的状态
            target.startAnimation(this)
        }
    }

    fun stopAnimation(target: View){
        AnimationUtils.loadAnimation(target.context, R.anim.indicator_rotate_anim_stop).apply {
            fillAfter = true
            target.startAnimation(this)
        }
    }
}